package com.wjf.birdfish.util;



/**
*Generator ID
*
*
*/
public class Dbid{
	
	/**
	static IDGenerator IDG=null;
	
	static{
		try{
			String format[]=new String[]{"UA5","AN4","N4","AN4"};
			IDG=new IDGenerator(format,"-");
		}catch(Exception ex){
			ex.printStackTrace();
		}
	}
	**/
	
	/**
	*Usage sample:
	*String yourID=Faimis.getID();
	*/
	public static String getID(){
		UUIDHexGenerator uuidHex=new UUIDHexGenerator();
		return uuidHex.generate().toString();
		 
		//return IDG.generateID();
	}
	
	/**
	 * 生成纯数字的唯一ID值
	 * @return
	 */
	public static String getLongID() {
		java.util.Date dt = new java.util.Date();
        long lg = dt.getTime();
        Long ld = new Long(lg);
        return ld.toString();
	}
	
	public static String getLongID(int size) {
		return GeneratorRondom.getId(size);
	}
	
	public static void main(String[] args) {
		int i = 2000;
		while (i-- > 0) {
			System.out.println(Dbid.getLongID(1));
		}
	}
}